<template>
  <el-row class="menu-page">
    <el-col>
      <el-menu
        class="el-menu-vertical-demo"
        background-color="#324057"
        text-color="#fff"
        active-text-color="#409eff"
      >
        <router-link to="/home">
          <el-menu-item index="0">
            <i class="el-icon-house"></i>
            <span slot="title">首页</span>
          </el-menu-item>
        </router-link>

        <template v-for="item in items">
          <el-submenu v-if="item.children" :index="item.path" :key="item.path">
            <template slot="title">
              <i :class="item.icon"></i>
              <span slot="title">{{ item.name }}</span>
            </template>
            <router-link
              v-for="(citem, cindex) in item.children"
              :to="citem.path"
              :key="cindex"
            >
              <el-menu-item :index="citem.path">
                <span slot="title">{{ citem.name }}</span>
              </el-menu-item>
            </router-link>
          </el-submenu>
        </template>
      </el-menu>
    </el-col>
  </el-row>
</template>

<script>
export default {
  name: 'leftmenu',
  data () {
    return {
      items: [
        {
          icon: 'el-icon-s-order',
          name: '资金管理',
          path: 'fund',
          children: [
            { path: "fundlist", name: '资金流水' }
          ]
        },
        {
          icon: 'el-icon-message',
          name: '信息管理',
          path: 'info',
          children: [
            { path: "infoshow", name: '个人信息' }
          ]
        }
      ]
    }
  }
}
</script>

<style scoped>
.menu-page {
  min-height: 100%;
  background: #324057;
  z-index: 99;
}
.el-menu {
  border: none;
}
.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 200px;
  min-height: 400px;
  background: #324057;
}
.el-menu-item {
  background-color: #6f8cb9;
}
.hiddenDropdown,
.hiddenDropname {
  display: none;
}
a {
  text-decoration: none;
}
</style>